import 'package:flutter/material.dart';
import 'package:mpflutter_template/demo/color_constant.dart';

import 'query_receive_widget.dart';
import 'query_send_widget.dart';

class QueryCardWidget extends StatelessWidget {
  bool isSendQuery = true;
  @override
  Widget build(BuildContext context) {
    return Container(
      color: ColorConstant.white,
      child: StatefulBuilder(
        builder: (context,setState){
          return Column(
            children: [
              Container(
                height: 30,
                child: Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Row(
                      mainAxisAlignment: MainAxisAlignment.start,
                      children: [
                        GestureDetector(
                          onTap: (){
                            isSendQuery = !isSendQuery;
                          },
                          child: Text("待寄件"),
                        ),
                        GestureDetector(
                          onTap: (){
                            isSendQuery = !isSendQuery;
                          },
                          child: Text("待取件"),
                        ),
                      ],
                    ),
                    Text("查看全部")
                  ],
                ),
              ),
              Container(
                width: 160,
                height: 120,
                child: isSendQuery ? QuerySendWidget():QueryReceiveWidget(),
              )
            ],
          );
        },
      ),
    );
  }

}